function check() {
	var username = document.getElementById('username').value;
	var pwd = document.getElementById('pwd').value;
	var pwdconfirm = document.getElementById('pwdcon').value;
	var flag = true;

	if (username == '' || pwd == '' || pwdconfirm == '') {
		alert('用户名或密码不能为空！');
		flag = false;
	} else if (username.length < 6) {
		alert('用户名的长度不能小于6位');
		flag = false;
	} else if (pwd.length < 6) {
		alert('密码的长度不能小于6位');
		flag = false;
	} else if (pwd != pwdconfirm) {
		alert('两次密码不一致');
		flag = false;
	} else {
		flag = true;
	}
	return flag;
}

function clearinfo() {
	var sign = confirm('你确定要清除所有的信息吗？');
	if (sign == true) {
		document.getElementById('username').value = '';
		document.getElementById('pwd').value = '';
		document.getElementById('pwdcon').value = '';
		return true;
	} else {
		return false;
	}
}
